package com.lagou.mapper;

import com.lagou.pojo.Novel;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 *
 */
@Mapper
public interface NovelDao {

    @Insert("INSERT INTO novel(id,title,author,pic,content) VALUES(#{id},#{title},#{author},#{pic},#{content})")
    public int NovelInsert(@Param("id")Long id, @Param("title")String title, @Param("author")String author, @Param("pic")String pic, @Param("content")String content);
    @Select({"select * from novel p where p.id=#{id}"})
    public Novel select(@Param("id") Long id);


    @Insert("INSERT INTO users(username,PASSWORD,address) VALUES(#{username},#{PASSWORD},#{address})")
    public int UsersInsert(@Param("username")String username, @Param("PASSWORD")String PASSWORD, @Param("address")String address);

    @Insert("INSERT INTO sys_region(region_name,region_code,region_level) VALUES(#{region_name},#{region_code},#{region_level})")
    public int Insert(@Param("region_name")String region_name, @Param("region_code")String region_code, @Param("region_level")String region_level);

}
